package cn.wen.eeayjoke.adapter.home;

import java.util.List;

import cn.wen.base.adapter.recyclerview.QuickRecyclerViewHolder;
import cn.wen.base.adapter.recyclerview.QuickVAdapter;
import cn.wen.base.vlayout.LayoutHelper;
import cn.wen.eeayjoke.R;
import cn.wen.eeayjoke.entity.bean.home.IndexTopicItems;
import cn.wen.eeayjoke.utils.ItemTypes;

/**
 * 限时抢购
 */

public class LimitAdapter extends QuickVAdapter<IndexTopicItems> {
    public LimitAdapter(List<IndexTopicItems> data, LayoutHelper layoutHelper, int layoutId) {
        super(data, layoutHelper, layoutId);
    }

    @Override
    protected void convert(QuickRecyclerViewHolder holder, IndexTopicItems item, int position) {
        if (position == 0) {
            // 第一个，限时抢购
            holder.displayImage(R.id.iv_tip_icon, item.tip_pic);
            holder.displayImage(R.id.iv_icon_limit_inner, item.pic_path);
        } else {
            holder.displayImage(R.id.iv_icon_limit, item.pic_path);
        }
    }

    @Override
    public int getItemViewType(int position) {
        return ItemTypes.TYPE_LIMIT;
    }
}
